<template>
	<view class="pageContent">

		<view class="remoteMain" @click="doorListCli(index)" v-for="(item,index) in doorList" :key="index">
			<image class="remoteBac" v-show="doorIndex==index" :src="images +'/selectGate.png'" />
			<image class="remoteIco" :src="localImages +'/damen.png'" />
			<view class="remoteGate">{{item.equipmentTypeName || '悦江苑 东门'}}</view>
			<image class="remoteSel" v-if="doorIndex==index" :src="localImages +'/doorSelect.png'" />
		</view>
	</view>
</template>

<script>
	import config from '../../static/config.js'
	import util from '../../static/utils/util.js'
	export default {
		data() {
			return {
				images: config.images,
				localImages: config.localImages,
				title: '123',
				doorList: 0,
				doorIndex: -1,
			}
		},
		onLoad() {
			this.taskTypeList()
		},
		methods: {
			async taskTypeList() {
				var url = '/UserServer/mini/install/taskTypeList'
				var options = {
					url
				}
				var param=await util.requestPro(options)
				this.doorList=param
			},
			async doorListCli(id) {
				this.doorIndex = id
				var phone = wx.getStorageSync('phone');
				var openId = wx.getStorageSync('openId');
				if (this.doorList[id] && this.doorList[id].equipmentTypeId) {
					var equipmentTypeId = this.doorList[id].equipmentTypeId;
				} else {
					var equipmentTypeId = 1;
				}
				var userInfo = wx.getStorageSync('userInfo');
				var url = '/UserServer/mini/install/login'
				var params = {
					"telephone": phone,
					"openId": openId,
					"equipmentTypeId": equipmentTypeId,
					"portraitUrl": userInfo.avatarUrl
				}
				var method = "POST"
				var options = {
					url,
					params,
					method
				}
				var param=await util.requestPro(options)
				wx.setStorageSync('info',param)
				this.returnMain()
			},
			returnMain() {
				wx.reLaunch({
					url: '/pages/index/index'
				})
			},

		},

	}
</script>

<style>
	.pageContent {
		display: flex;
		flex-direction: column;
		padding: 20rpx 0rpx 0rpx 0rpx;
	}

	.remoteMain {
		position: relative;
		display: flex;
		flex-direction: column;
		justify-content: center;
		box-shadow: 4px 4px 22px 2px rgba(212, 212, 212, 0.39);
		/* width: 100%; */
		height: 120rpx;
		border-radius: 20rpx;
		padding: 0rpx 20rpx 0rpx 116rpx;
		margin: 0rpx 30rpx 0rpx 30rpx;
		background: #FFFFFF;
		margin-bottom: 20rpx;
		z-index: 0;
		/* border 1px solid #666 */
	}

	.remoteBac {
		position: absolute;
		width: 100%;
		height: 100%;
		top: 0rpx;
		left: 0rpx;
		z-index: -1;
	}

	.remoteIco {
		position: absolute;
		top: 50%;
		left: 40rpx;
		margin-top: -25rpx;
		width: 56rpx;
		height: 46rpx;
		background: #84D7FF;
	}

	.remoteSel {
		position: absolute;
		bottom: 0rpx;
		right: 0rpx;
		width: 56rpx;
		height: 46rpx;
	}



	.loginMBt {
		width: 70%;
		margin: 50rpx 0rpx 0rpx 0rpx;
	}
</style>
